﻿using System;
using System.Windows;
using System.Windows.Media;
using System.Windows.Shapes;
using System.Runtime.Serialization;
using System.Collections.Generic;

namespace FKRP.WP7.Library.SkeletonTracker
{
    [DataContract(Name = "bone")]
    public class Bone
    {
        [DataMember(Name = "color")] public String Color { get; set; }
        [DataMember(Name = "points")] public List<BonePoint> Points { get; set; }

        public Polyline GetLine()
        {
            var polyLine = new Polyline { StrokeThickness = 5, Stroke = new SolidColorBrush(Common.ParseColor(Color)) };
            Points.ForEach(point=> polyLine.Points.Add(new Point(point.X * 1.5, point.Y * 1.5)));

            return polyLine;
        }
    }
}
